home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995…tember: Reference Library / Dev.CD Sep 95 RL / Dev.CD Sep 95 RL.toast / mac / Technical Documentation / develop / develop Issue 21 code / Hierarchical Lists / Libs / CCustomListBox.h < prev    next >
Encoding:
Text File  |  1994-08-17  |  1.7 KB  |  53 lines  |  [TEXT/MMCC]

  1. // ===========================================================================
  2. //    CCustomListBox.h            ©1994 Jan Bruyndonckx All rights reserved.
  3. //    v1.0 18/6/94
  4. //
  5. //    A listbox subclass containing custom data.
  6. //  The default listbox contains only string data.
  7. // ===========================================================================
  8.  
  9. #pragma once
  10.  
  11. #include <LListBox.h>
  12.  
  13. //----------------------------------------------------------------------------
  14.  
  15. class CCustomListBox : public LListBox {
  16.  
  17.   public:
  18.       enum {
  19.           classID = 'clst'
  20.       } ;
  21.         
  22.     static CCustomListBox*    CreateFromStream(LStream *inStream);
  23.  
  24.     CCustomListBox() ;
  25.     CCustomListBox(const SPaneInfo &inPaneInfo,
  26.                         Boolean inHasHorizScroll, Boolean inHasVertScroll,
  27.                         Boolean inHasGrow, Boolean inHasFocusBox,
  28.                         MessageT inDoubleClickMessage, Int16 inTextTraitsID,
  29.                         LCommander *inSuper);
  30.     CCustomListBox(LStream *inStream);
  31.     
  32.     virtual void         *GetSelection(void *outDescriptor, short *outDescLen) const;
  33.     virtual void        SetSelection(const void *inDescriptor, const short inDescLen);
  34.  
  35.     virtual void         *GetCellPtr (const Cell cell) ;
  36.  
  37.   protected:
  38.     virtual void         DrawElement (const short lMessage, const Boolean lSelect, const Rect *lRect,
  39.                                      const void *lElement, const short lDataLen) ;
  40.     virtual void        DrawElementSelf (const Rect *lRect, const void *lElement, const short lDataLen) ;
  41.  
  42.   private:
  43.       
  44.       void                init (void) ;
  45.       friend pascal void  LDefProc (short lMessage, Boolean lSelect, Rect *lRect,
  46.                                      Cell lCell, unsigned short lDataOffset, unsigned short lDataLen, ListHandle lHandle) ;
  47.  
  48.       static ListDefUPP    callerLDEFUPP ;
  49.       
  50.       enum {
  51.           callerLDEFResID = 1100 
  52.       } ;
  53. } ;